package 四平方和;

import java.util.Arrays;
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        int[] C = new int[2 * n + 1];
        int[] D = new int[2 * n + 1];
        Arrays.fill(C, -1);
        for (int c = 0; c * c <= n; c++) {
            for (int d = c; d * d <= n; d++) {
                int s = c * c + d * d;
                if (C[s] == -1) {
                    C[s] = c;
                    D[s] = d;
                }
            }
        }
        for (int a = 0; a * a <= n; a++) {
            for (int b = a; b * b <= n; b++) {
                int s = n - a * a - b * b;
                if (s>0&&C[s] != -1) {
                    System.out.println(a+" "+b+" "+C[s]+" "+D[s]);
                    return;
                }
            }
        }
    }
}
